import React from 'react';
import { DataSet } from 'choerodon-ui/pro/lib';
import { Switch, Form } from 'choerodon-ui/pro';

interface ModalDetailProps {
  ds: DataSet,
  modal?: any,
}
const ModalDetail: React.FC<ModalDetailProps> = ({ ds, modal }) => {

  const handleSwitch = (value: boolean) => {
    modal.update({
      okProps: { disabled: !value },
    });
  };

  return (
    <div>
      <p>文档内容</p>
      <Form dataSet={ds}>
        <Switch name="isRead" onChange={handleSwitch} />
      </Form>
    </div>
  );
};

export default ModalDetail;